const toSlash = (url) => url.replace(/\//g, '\\');

module.exports = {
  chinaPath: toSlash(`${process.cwd()}/src/project-mock/china-data/china.json`),
  filePath: (fileName) => {
    if (!fileName) {
      console.log('\x1B[31m%s\x1B[0m', '请正确书写存储数据文件路径!!!');
      return null;
    }
    return toSlash(`${process.cwd()}/src/project-mock/${fileName}`);
  },
  Path: (url) => toSlash(`${process.cwd()}/${url}`),
};
